﻿using SqlSugar;
using SqlSugar.IOC;
using System;
using System.Collections.Generic;
using System.Text;

namespace TransitFastMail.Repository
{
    public class UnitOfWork : IUnitOfWork
    {
        ISqlSugarClient _client;
        public UnitOfWork()
        {
            _client = DbScoped.Sugar;
        }

        public ISqlSugarClient GetClient()
        {
            return _client;
        }

        public IRepository<T> Repository<T>() where T : class, new()
        {
            return new Repository<T>(_client);
        }
    }
}
